#ifndef TEST14_H
#define TEST14_H

#include <QWidget>
#include <QThread>
#include <QMutex>
namespace Ui {
class test14;
}
class test14_file : public QThread
{
    Q_OBJECT
public:
    void startwrite(int time,int count,QString data,QString filename);
    bool Stopwrite(bool state);
    bool write();
signals:
    void sig_infotime(int time);
    void sig_infocount(int count);
    void sig_over(int errorinfo);//测试结束标识
private:
    int Time;
    int Count;
    QString Data;
    QString FileName;
    bool flag_stop=false;
    QMutex mutex_stop;
    bool test_stop();
    void run() override;
};

class test14 : public QWidget
{
    Q_OBJECT

public:
    explicit test14(QWidget *parent = nullptr);
    ~test14();

private slots:
    void on_pushButton_clicked();

    void on_pushButton_3_clicked();

    void slot_over(int errorinfo);
private:
    test14_file *my_thread;
    Ui::test14 *ui;

    void initital();
};

#endif // TEST14_H
